<?php if (!defined('BASEPATH')) exit('No direct script access allowed');

class Customer_model extends CI_Model
{
	private $table_name			= 'users';			// user accounts

	function __construct(){
		parent::__construct();

	}
	
	/*function update_customer($id_customer, $data){
		$this->db_front->where('id', $id_customer);
        $this->db_front->update($this->table_name, $data);
	}*/
	
	/*function delete_customer($id_customer){
		 $this->db_front->delete($this->table_name, array('id'=>$id_customer)); 
	}*/
	
	function getAll($page='', $limit=''){
		if(!empty($limit))
		$this->db_front->limit($limit,$page);
		
		$query = $this->db_front->get('users');
		
		if($query -> num_rows() > 0){
			foreach ($query -> result() as $rows){
				$data[] = $rows;	
			}	
			return $data;
		}	
	}
	
	function delete_store($user_id){
        $this->db_front->delete('store', array('user_id'=>$user_id));
    }
	
	/*function select($id_customer){
        return $this->db_front->get_where('users', array('id'=>$id_customer))->row();
    }*/
}